PROJECT(tiny_datastruct)
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
MESSAGE(STATUS "PROJECT: Tiny_c_datastruct")
set(CMAKE_CXX_FLAGS "-std=c11")

include_directories(
${PROJECT_SOURCE_DIR}/include/binarytree.h
${PROJECT_SOURCE_DIR}/include/list.h
${PROJECT_SOURCE_DIR}/include/node.h
${PROJECT_SOURCE_DIR}/include/priorityqueue.h
${PROJECT_SOURCE_DIR}/include/queue.h
${PROJECT_SOURCE_DIR}/include/testdatastruct.h
${PROJECT_SOURCE_DIR}/include/testsort.h
${PROJECT_SOURCE_DIR}/include/unionset.h
${PROJECT_SOURCE_DIR}/include/vector.h
)

set(SRC
${PROJECT_SOURCE_DIR}/main.c 
${PROJECT_SOURCE_DIR}/include/binarytree.c 
${PROJECT_SOURCE_DIR}/include/list.c 
${PROJECT_SOURCE_DIR}/include/priorityqueue.c 
${PROJECT_SOURCE_DIR}/include/queue.c 
${PROJECT_SOURCE_DIR}/include/testdatastruct.c 
${PROJECT_SOURCE_DIR}/include/unionset.c 
${PROJECT_SOURCE_DIR}/include/vector.c
)

set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib)

set(LIB_NAME tiny_datastruct_lib)
add_library(${LIB_NAME} STATIC ${SRC})

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin)
add_executable(${PROJECT_NAME} ${SRC})
target_link_libraries(${PROJECT_NAME} ${LIB_NAME})
